package com.example.spring_principle;

import com.example.autoconfig.BiteConfig;
import com.example.autoconfig.BiteConfig2;
import com.example.autoconfig.EnableBiteConfig;
import com.example.autoconfig.MyImport;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;

//@ComponentScan({"com.example.autoconfig", "com.example.spring_principle"})
//@Import({BiteConfig.class, BiteConfig2.class})
//@Import(MyImport.class)
//@EnableBiteConfig // 常用: 注解方式, META-INF/spring/...文件方式
@SpringBootApplication
public class SpringPrincipleApplication {

	public static void main(String[] args) {
		ApplicationContext context = SpringApplication.run(SpringPrincipleApplication.class, args);
		BiteConfig bean = context.getBean(BiteConfig.class);
		bean.use();

		BiteConfig2 bean2 = context.getBean(BiteConfig2.class);
		bean2.use();
	}

}
